<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input[type=text] {
            width: 80%;
            box-sizing: border-box;
            border: 2px solid #ccc;
            border-radius: 4px;
            font-size: 16px;
            background-color: white;
            background-repeat: no-repeat;
            padding: 12px 20px;
        }

        input[type=submit] {
            width: 20%;
            background-color: #4CAF50;
            border: 2px solid transparent;
            border: none;
            color: white;
            padding: 12px 20px;
            text-decoration: none;
            margin: 4px 2px;
            cursor: pointer;
        }

        #customers {
            font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
            width: 100%;
            border-collapse: collapse;
        }

        #customers td,
        #customers th {
            font-size: 1em;
            border: 1px solid #98bf21;
            padding: 3px 7px 2px 7px;
        }

        #customers th {
            font-size: 1.1em;
            text-align: left;
            padding-top: 5px;
            padding-bottom: 4px;
            background-color: #A7C942;
            color: #ffffff;
        }
    </style>
</head>

<body>
    <h1 style="margin: 10px auto; text-align: center;">{$test}</h1>
    <form method="get" style="display: flex; align-content: center; justify-content: space-evenly; margin: 20px auto;">
        <input type="text" name="keyword" placeholder="请输入手机号">
        <select name="gender">
            <option value="0">保密</option>
            <option value="1">男</option>
            <option value="2">女</option>
        </select>
        <input type="submit" value="搜索">
    </form>
    <table id="customers">
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>手机号</th>
            <th>性别</th>
            <th>操作</th>
        </tr>
        {foreach $businessData as $item}
        <tr>
            <td>{$item.id}</td>
            <td>{$item.nickname ? $item.nickname : $item.mobile}</td>
            <td>{$item.mobile}</td>
            <td>
                {if condition="$item.gender == 0"}
                保密
                {elseif condition="$item.gender == 1" }
                男
                {elseif condition="$item.gender == 2"}
                女
                {/if}
            </td>

            <!-- <td>
                {$item.gender}
            </td> -->
            <td><a href="{:url('test/index/info',['id' => $item.id])}">查看</a></td>
        </tr>
        {/foreach}
    </table>
</body>

</html>